package org.example.demo;

import java.util.Scanner;

public class TestMain {
    public static void main(String[] args) {
        CompareDatabaseUtil compareDatabaseUtil = new CompareMysqlV5Util();
        UrlParam source = new UrlParam(),target = new UrlParam();
        Scanner scanner = new Scanner(System.in);
        System.out.println("请依次输入源数据库的url、用户名、密码，需要换行：");
        source.setUrl(scanner.nextLine());
        source.setUser(scanner.nextLine());
        source.setPassword(scanner.nextLine());
        System.out.println("请依次输入目标数据库的url、用户名、密码，需要换行：");
        target.setUrl(scanner.nextLine());
        target.setUser(scanner.nextLine());
        target.setPassword(scanner.nextLine());
        System.out.println("请输入要对比的表名：");
        String tableName = scanner.nextLine();
        CompareResult result = compareDatabaseUtil.compareTable(source, target, tableName);
        System.out.println("执行成功，执行结果在："+result.getResult()+"文件中。");
    }
}
